<!DOCTYPE html>
<html>
	<head>
		<meta charset="utf-8">
		<title>字符串移动插入</title>
	</head>
	<body>
		<script>
		function translate(str) {
			//元音字母
			var vowel=["a","e","i","o","u"];
			for(var i=0;i<str.length;i++){
				for(var j=0;j<vowel.length;j++){
					if(str[i]==vowel[j]){
						if(i==0){
							str=str+"way";
							return str;
						}else{
							str=str.slice(i)+str.slice(0,i)+"ay";
							return str;
						}
					}else{
						
					}
				}
			}
		    return str;
		}
		
		document.write(translate("glove"));
		</script>
	</body>
</html>
